const express = require('express')
const commentsoperation = require('../controllers/comments') // 处理文章请求
// const validate = require('../validator/article') //配置文章校验
const tokenverify = require('../middleware/tokenverify') // token验证
const router = express.Router()

// 获取文章评论列表
router.get('/', commentsoperation.getCommentsList)

// 文章评论点赞
router.post('/', tokenverify, commentsoperation.addCommentsPraise)

// 取消文章评论点赞
router.delete('/', tokenverify, commentsoperation.delCommentsPraise)

// 添加文章评论或添加评论回复
router.post('/add', tokenverify, commentsoperation.addComments)

module.exports = router
